using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class InventoryGrid : MonoBehaviour
{
    public Text nameText;
    [SerializeField] private Text numText;
    public Image iconImg;

    public void UIInit(int itemId, int itemNum)
    {
        Item go = null;
        foreach (var item in Data.Items)
        {
            if (item.Id == itemId)
            {
                go = item;
            }
        }
        nameText.text = go.Name;
        numText.text = itemNum.ToString();

        iconImg.sprite = (Sprite)Resources.Load(go.Name, typeof(Sprite));
    }
    void Start()
    {

    }

}
